package com.wantyx.creation.prototype;

import com.alibaba.fastjson2.JSONObject;
import com.wantyx.bean.database.IDataBase;
import com.wantyx.bean.database.Mysql;

/**
 * 作者 : wantyx
 * 创建时间 : 2023/11/6
 * 实现功能 :
 */
public class Prototype extends IDataBase implements Cloneable{

    private Mysql object = new Mysql();
    public Prototype(String username,String password){
        this.setPassword(password);
        this.setUserName(username);
    }

    public Prototype clone() throws CloneNotSupportedException {
        return (Prototype) super.clone();
    }

    public Prototype deepClone(){
        JSONObject from = JSONObject.from(this);
        String jsonString = from.toJSONString();
        return JSONObject.parseObject(jsonString, getClass());
    }

    public Mysql getObject() {
        return object;
    }

    public void setObject(Mysql object) {
        this.object = object;
    }
}
